function drawHist2D(hist, T)
    % DRAWHIST2D  draw DCT-coff histgram.
    % DRAWHIST2D(HIST, T) draws image's DCT-coef distribution using bar,
    % where HIST is a matrix for DCT-coef histgram, and T is the range.
    figure;
    handle = bar3(hist);
    [M,N]=size(hist);
    if nargin < 2
        T = floor(M/2);
    end
    v=caxis();
    axis([0 M+1 0 N+1 0 1 v]);
    set(gca,'xticklabel',{'.'})
    set(gca,'yticklabel',{'.'})
    grid on;
    colormap(summer);
    xlabel('VALUE1');
    ylabel('VALUE2');
    zlabel('PERCENTAGE');
end
